﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Join
{
    public static class CheckedListBoxExtensions
    {
        public static IEnumerable<string> CheckedItemsAsString(this System.Windows.Forms.CheckedListBox checkListBox)
        {
            foreach (string item in checkListBox.CheckedItems)
            {
                yield return item;
            }
        }

        public static bool CheckedItemsIgnoringCaseContains(this System.Windows.Forms.CheckedListBox checkListBox, string header)
        {
            foreach (string item in checkListBox.CheckedItems)
            {
                if (item.Equals(header, StringComparison.InvariantCultureIgnoreCase))
                {
                    return true;
                }
            }
            return false;
        }

    }
}
// Microsoft Research, eScience Research Group, Microsoft Public License (Ms-PL)
// Copyright (c) Microsoft Corporation. All rights reserved. 